package com.letian.record.service.impl;

import java.util.List;
import com.letian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.letian.record.mapper.RecordMoneyMapper;
import com.letian.record.domain.RecordMoney;
import com.letian.record.service.IRecordMoneyService;

/**
 * 记录金钱Service业务层处理
 * 
 * @author bmz
 * @date 2023-01-15
 */
@Service
public class RecordMoneyServiceImpl implements IRecordMoneyService 
{
    @Autowired
    private RecordMoneyMapper recordMoneyMapper;

    /**
     * 查询记录金钱
     * 
     * @param moneyId 记录金钱主键
     * @return 记录金钱
     */
    @Override
    public RecordMoney selectRecordMoneyByMoneyId(Long moneyId)
    {
        return recordMoneyMapper.selectRecordMoneyByMoneyId(moneyId);
    }

    /**
     * 查询记录金钱列表
     * 
     * @param recordMoney 记录金钱
     * @return 记录金钱
     */
    @Override
    public List<RecordMoney> selectRecordMoneyList(RecordMoney recordMoney)
    {
        return recordMoneyMapper.selectRecordMoneyList(recordMoney);
    }

    /**
     * 新增记录金钱
     * 
     * @param recordMoney 记录金钱
     * @return 结果
     */
    @Override
    public int insertRecordMoney(RecordMoney recordMoney)
    {
        recordMoney.setCreateTime(DateUtils.getNowDate());
        return recordMoneyMapper.insertRecordMoney(recordMoney);
    }

    /**
     * 修改记录金钱
     * 
     * @param recordMoney 记录金钱
     * @return 结果
     */
    @Override
    public int updateRecordMoney(RecordMoney recordMoney)
    {
        recordMoney.setUpdateTime(DateUtils.getNowDate());
        return recordMoneyMapper.updateRecordMoney(recordMoney);
    }

    /**
     * 批量删除记录金钱
     * 
     * @param moneyIds 需要删除的记录金钱主键
     * @return 结果
     */
    @Override
    public int deleteRecordMoneyByMoneyIds(Long[] moneyIds)
    {
        return recordMoneyMapper.deleteRecordMoneyByMoneyIds(moneyIds);
    }

    /**
     * 删除记录金钱信息
     * 
     * @param moneyId 记录金钱主键
     * @return 结果
     */
    @Override
    public int deleteRecordMoneyByMoneyId(Long moneyId)
    {
        return recordMoneyMapper.deleteRecordMoneyByMoneyId(moneyId);
    }
}
